| C1.C1Flash.2 Assembly > C1.C1Flash Namespace > FPage Class > DrawPolygon Method : DrawPolygon(Pen,PointF[]) Method |
The polygon is drawn by joining each pair of points with a line, and connecting the last point in the array with the first one.
The DrawPolygon method draws the outline of the polygon. To fill the polygon, use the FillPolygon(Brush,Point[]) method.
C1FlashCanvas canvas = new C1FlashCanvas(); Point[] points = new Point[4]{ new Point(100, 100), new Point(200, 100), new Point(300, 200), new Point(100, 200) }; // fill the polygon canvas.FillPolygon(Brushes.LightBlue, points); // draw the polygon Pen pen = new Pen(Color.Blue, 3); canvas.DrawPolygon(pen, points);canvas.RenderToFile(@"c:\temp\polygon.swf");